package service.impl;

import dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Student;
import service.StudentService;

import java.util.List;

@Service("studentService")
public class StudentServiceImply implements StudentService {
    @Autowired
    private StudentDao studentDao;

    @Override
    public int count(Student student) {
        return studentDao.count(student);
    }

    @Override
    public List<Student> findAll(Student student, int offset, int pageSize) {

        List<Student> students = studentDao.findAll(student, offset, pageSize);
        return students;
    }

    @Override
    public int addSave(Student student) {
        return studentDao.addSave(student);
    }

    @Override
    public int deleteStudentById(Integer id) {
        return  studentDao.deleteStudentById(id);
    }

    @Override
    public Student findStudentById(Integer id) {
        return studentDao.findStudentById(id);
    }

    @Override
    public int updateStudent(Student student) {
        return  studentDao.updateStudent(student);
    }


}
